#include <stdio.h>

struct S1
{
    char c1;
    char c2;
    int i;
};

struct S2
{
    char c1;
    int i;
    char c2;
};

struct S3
{
    double d;
    char c;
    int i;
};

struct S4
{
    char c1;
    struct S3 s3;
    double d;
};

int main()
{
    printf("%zd\n", sizeof(struct S1)); //8     
    printf("%zd\n", sizeof(struct S2)); //12    
    printf("%zd\n", sizeof(struct S3)); //16    
    printf("%zd\n", sizeof(struct S4)); //32    
    //but why?
    return 0;
}